package com.orion.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.orion.dao.UserDao;
import com.orion.entity.User;
import com.orion.service.UserService;
import org.springframework.stereotype.Service;

import java.io.Serializable;
import java.util.List;

/**
 * (User)表服务实现类
 *
 * @author makejava
 * @since 2021-08-27 21:22:26
 */
@Service("userService")
public class UserServiceImpl extends ServiceImpl<UserDao, User> implements UserService {

    @Override
    @DS("slave_1")
    public IPage<User> page(IPage<User> page, Wrapper<User> queryWrapper) {
        return super.page(page, queryWrapper);
    }

    @Override
    public boolean save(User entity) {
        return super.save(entity);
    }

    @Override
    public boolean saveOrUpdate(User entity) {
        return super.saveOrUpdate(entity);
    }

    @Override
    public boolean update(User entity, Wrapper<User> updateWrapper) {
        return super.update(entity, updateWrapper);
    }

    @Override
    public boolean updateById(User entity) {
        return super.updateById(entity);
    }

    @Override
    @DS("slave_1")
    public User getById(Serializable id) {
        return super.getById(id);
    }

    @Override
    @DS("slave_1")
    public User getOne(Wrapper<User> queryWrapper) {
        return super.getOne(queryWrapper);
    }

    @Override
    @DS("slave_1")
    public List<User> list(Wrapper<User> queryWrapper) {
        return super.list(queryWrapper);
    }
}
